package com.open.fei.controller;

import com.open.fei.entities.CommonResult;
import com.open.fei.entities.ResponseObject;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zhaoYuFei
 */
@RestController
@RefreshScope
@RequestMapping("/pay")
public class TestController {
    @Value("${config.info}")
    private  String configInfo;

    @GetMapping("/test")
    public ResponseObject test(){
        int i=1/0;
        return ResponseObject.success(configInfo);
    }
    @GetMapping("/test1")
    public CommonResult test1(@RequestHeader(value = "msg",required = false) String msg){
        return new CommonResult<String>(msg);
    }
}
